package org.simple.spring;

import org.simple.spring.ssh.service.FooService;
import org.simple.spring.ssh.service.ProductService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * 项目名称：spring-leaning
 * 类名称：SpringApplication
 * 类描述：SpringApplication
 * 创建时间：2018/8/6
 *
 * @author guihuo   (E-mail:1620657419@qq.com)
 * @version v1.0
 */
public class SpringApplication {


    public static void main(String[] args) {

        ApplicationContext context = new ClassPathXmlApplicationContext(new String[]{"applicationContext.xml"});

        //基于XML的AOP
        ProductService s = (ProductService) context.getBean("productService");
        s.doSomeService();

        //基于注解的AOP
        FooService fooService = context.getBean(FooService.class);
        fooService.doSomeService();

    }

}
